package com.example.mrzhou.srtfoodapplication;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

/**
 * Created by SRTfood on 2017/1/19.
 */

public class SubscriberContentLayout extends LinearLayout {

    //用户页面

    public SubscriberContentLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.subscriber_content,this);

        //联系客服功能
        Button Customer_Service= (Button) findViewById(R.id.customer_service);
        Customer_Service.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent_a = new Intent(Intent.ACTION_DIAL);
                intent_a.setData(Uri.parse("tel:15857302236"));
                getContext().startActivity(intent_a);
            }
        });

        //加盟我们功能
        final Button Joinus = (Button) findViewById(R.id.joinus_button);
        Joinus.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent_b = new Intent(getContext(),JoinUs.class);
                getContext().startActivity(intent_b);
            }
        });
    }
}
